
/**
 * 
 * 
 * @param {number[]} nums 
 * @param {number} target 
 * @returns {number[]}
 */
var twoSum = function (nums, target) {
    var len = nums.length;
    for (var i = 0; i < len - 1; i++) {
        for (var j = i + 1; j < len; j++) {
            if (nums[i] + nums[j] == target) {
                return [i, j];
            }
        }
    }
    return null;
};

// test

console.log(twoSum([2, 7, 11, 15], 9));
